package com.xd.clap.controller;

import com.xd.clap.entity.request.ResultsParam;
import com.xd.clap.entity.response.Result;
import com.xd.clap.services.ResultsService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/results")
public class ResultsController {

    @Resource
    private ResultsService rs;

    /**
     * 通过建议ID查询建议和处理结果
     */
    @PostMapping("/getResultsByAdviseId")
    public Result getResultsByAdviseId(@RequestBody ResultsParam resultsParam) {
        return rs.getResultsByAdviseId(resultsParam.getAid());
    }

    /**
     * 上传处理结果
     */
    @PostMapping("/uploadResults")
    public Result uploadResults(@RequestBody ResultsParam resultsParam) {
        return rs.uploadResults(resultsParam);
    }


    /**
     * 驳回处理结果
     */
    @PostMapping("/rejectedResults")
    public Result rejectedResults(@RequestBody ResultsParam resultsParam) {
        return rs.rejectedResults(resultsParam);
    }

    /**
     * 通过处理结果
     */
    @PostMapping("/passResults")
    public Result passResults(@RequestBody ResultsParam resultsParam) {
        return rs.passResults(resultsParam.getAid());
    }



}
